package cn.cf.kxx.model;

import android.text.TextUtils;

import java.lang.reflect.Field;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;

public class Device {
    private String id;// ID

    private Integer version;

    private String devBh;

    //设备别名
    private String name;

    //设备纬度
    private String latitude;

    //设备经度
    private String longitude;

    //设备区域
    private String region;

    //设备类型 0市电 1电池 2有线
    private Integer type;

    //备注
    private String remarks;

    //所属关系
    private String parentId;

    //机井地址
    private String wellAdr;

    //机井井号
    private String wellBh;

    //空域地址
    private String airspace;

    //过滤器控制方式
    private String control;

    //  主管道压变量程 单位kpa
    private String pressure;

    //  水位量程 单位kpa
    private String waterlevel;

    //  压差量程 单位kpa
    private String diffpressure;

    //  水泵启动时间判断电流 单位s
    private String pump;

    //  搅拌机定时关闭
    private String blenderTiming;

    //  管道压力下限值 单位kpa
    private String pipBotPressure;

    //  管道压力上限值 单位kpa
    private String pipTopPressure;

    //  管道流速上限值
    private String pipTopVelocity;

    //  管道流速下限值
    private String pipBotVelocity;

    //  肥池本次注水量 单位立方米
    private String injection;

    //  注肥流速下限值 单位l/h
    private String fatThreshold;

    //电话卡
    private String imei;

    //---------------状态 info------------------//

    //0远方(AA锁定) / 1近地(BB解锁)  /保留
    private String distance;
    //在线状态 0 在线  1离线
    private Integer linkStatus;
    //供电方式 0 市电 1 电池
    private Integer inPower;
    //充电状态 0 充电 1未充电  状态不完全同步
    private Integer charge;

    //---------------控制 info------------------//

    //首部水泵电源 off on  // type == 2  waterPower 水泵开
    private String waterPower;
    //水泵运行电流
    private String waterRunElect;
    //水泵运行电压
    private String waterRunVoltage;
    //出水阀门 off on  // type == 2  filterPower为卷帘机开
    private String filterPower;
    //排沙阀门         // type == 2  filterPower1为卷帘机关
    private String filterPower1;
    //施肥电源
    private String fluidPower;
    //流速阀门        // type == 2  velocityPower为补光灯开关
    private String velocityPower;

    //定时启动间隔秒
    private Integer filterTimer;
    //过滤器启停时间  控制自动启动
    private Integer filterTiming;
    //过滤器差压上限参数
    private Integer diffPressSetting;
    //肥罐搅拌机 on off
    private String fluidStir;
    //注水阀门 on off
    private String waterInjection;
    //蝶阀  on off   // type == 2  butterfly1  水泵关
    private String butterfly1;
    private String butterfly2;
    private String butterfly3;


    //排水泵
    private String drainage;
    //---------------配置 info------------------//

    //通道培肥比例
    private String fluidFormula;

    //---------------采集 info------------------//

    //过滤器差压 Mpa
    private String diffPress;
    //肥罐液位
    private Float fluidDepth;
    //机井水位
    private String wellDepth;
    //管道压力  Kpa
    private String pipPress;
    //瞬时流量
    private String flow;
    //累计流量
    private String flowSum;
    //注肥流速 l/h
    private String fatFlow;
    //注肥压力
    private String fatPress;

    //水泵运行电流下限
    private String botWaterRunElect;
    //水泵运行电流上限
    private String topWaterRunElect;
    //水泵运行电压下限
    private String botWaterRunVoltage;
    //水泵运行电压上限
    private String topWaterRunVoltage;
    //  管道流量下限值
    private String botPipTraffic;
    //  管道流量上限值
    private String topPipTraffic;

    public HashMap<String, Object> toHashMap() {
        HashMap<String, Object> map = new HashMap<>();
        Field[] fields = this.getClass().getDeclaredFields();
        for (Field field : fields) {
            try {
                field.setAccessible(true);
                Object value = field.get(this);
                if(value != null){
                    map.put(field.getName(), value);
                }

            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
        }
        return map;
    }

    public String getBotPipTraffic() {
        return botPipTraffic;
    }

    public void setBotPipTraffic(String botPipTraffic) {
        this.botPipTraffic = botPipTraffic;
    }

    public String getTopPipTraffic() {
        return topPipTraffic;
    }

    public void setTopPipTraffic(String topPipTraffic) {
        this.topPipTraffic = topPipTraffic;
    }

    public String getBotWaterRunElect() {
        return botWaterRunElect;
    }

    public void setBotWaterRunElect(String botWaterRunElect) {
        this.botWaterRunElect = botWaterRunElect;
    }

    public String getTopWaterRunElect() {
        return topWaterRunElect;
    }

    public void setTopWaterRunElect(String topWaterRunElect) {
        this.topWaterRunElect = topWaterRunElect;
    }

    public String getBotWaterRunVoltage() {
        return botWaterRunVoltage;
    }

    public void setBotWaterRunVoltage(String botWaterRunVoltage) {
        this.botWaterRunVoltage = botWaterRunVoltage;
    }

    public String getTopWaterRunVoltage() {
        return topWaterRunVoltage;
    }

    public void setTopWaterRunVoltage(String topWaterRunVoltage) {
        this.topWaterRunVoltage = topWaterRunVoltage;
    }

    public String getWaterRunElect() {
        return waterRunElect;
    }

    public void setWaterRunElect(String waterRunElect) {
        this.waterRunElect = waterRunElect;
    }

    public String getWaterRunVoltage() {
        return waterRunVoltage;
    }

    public void setWaterRunVoltage(String waterRunVoltage) {
        this.waterRunVoltage = waterRunVoltage;
    }

    public String getFatPress() {
        return fatPress;
    }

    public void setFatPress(String fatPress) {
        this.fatPress = fatPress;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }


    public String getDevBh() {
        return devBh;
    }

    public void setDevBh(String devBh) {
        this.devBh = devBh;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getLatitude() {
        return latitude;
    }

    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }

    public String getLongitude() {
        return longitude;
    }

    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }

    public String getRegion() {
        return region;
    }

    public void setRegion(String region) {
        this.region = region;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getWellAdr() {
        return wellAdr;
    }

    public void setWellAdr(String wellAdr) {
        this.wellAdr = wellAdr;
    }

    public String getWellBh() {
        return wellBh;
    }

    public void setWellBh(String wellBh) {
        this.wellBh = wellBh;
    }

    public String getAirspace() {
        return airspace;
    }

    public void setAirspace(String airspace) {
        this.airspace = airspace;
    }

    public String getControl() {
        return control;
    }

    public void setControl(String control) {
        this.control = control;
    }

    public String getPressure() {
        return pressure;
    }

    public void setPressure(String pressure) {
        this.pressure = pressure;
    }

    public String getWaterlevel() {
        return waterlevel;
    }

    public void setWaterlevel(String waterlevel) {
        this.waterlevel = waterlevel;
    }

    public String getDiffpressure() {
        return diffpressure;
    }

    public void setDiffpressure(String diffpressure) {
        this.diffpressure = diffpressure;
    }

    public String getPump() {
        return pump;
    }

    public void setPump(String pump) {
        this.pump = pump;
    }

    public String getBlenderTiming() {
        return blenderTiming;
    }

    public void setBlenderTiming(String blenderTiming) {
        this.blenderTiming = blenderTiming;
    }

    public String getPipBotPressure() {
        return pipBotPressure;
    }

    public void setPipBotPressure(String pipBotPressure) {
        this.pipBotPressure = pipBotPressure;
    }

    public String getPipTopPressure() {
        return pipTopPressure;
    }

    public void setPipTopPressure(String pipTopPressure) {
        this.pipTopPressure = pipTopPressure;
    }

    public String getPipTopVelocity() {
        return pipTopVelocity;
    }

    public void setPipTopVelocity(String pipTopVelocity) {
        this.pipTopVelocity = pipTopVelocity;
    }

    public String getPipBotVelocity() {
        return pipBotVelocity;
    }

    public void setPipBotVelocity(String pipBotVelocity) {
        this.pipBotVelocity = pipBotVelocity;
    }

    public String getInjection() {
        return injection;
    }

    public void setInjection(String injection) {
        this.injection = injection;
    }

    public String getFatThreshold() {
        return fatThreshold;
    }

    public void setFatThreshold(String fatThreshold) {
        this.fatThreshold = fatThreshold;
    }

    public String getImei() {
        return imei;
    }

    public void setImei(String imei) {
        this.imei = imei;
    }

    public String getDistance() {
        return distance;
    }

    public void setDistance(String distance) {
        this.distance = distance;
    }

    public Integer getLinkStatus() {
        return linkStatus;
    }

    public void setLinkStatus(Integer linkStatus) {
        this.linkStatus = linkStatus;
    }

    public Integer getInPower() {
        return inPower;
    }

    public void setInPower(Integer inPower) {
        this.inPower = inPower;
    }

    public Integer getCharge() {
        return charge;
    }

    public void setCharge(Integer charge) {
        this.charge = charge;
    }

    public String getWaterPower() {
        return waterPower;
    }

    public void setWaterPower(String waterPower) {
        this.waterPower = waterPower;
    }

    public String getFilterPower() {
        return filterPower;
    }

    public void setFilterPower(String filterPower) {
        this.filterPower = filterPower;
    }

    public String getFilterPower1() {
        return filterPower1;
    }

    public void setFilterPower1(String filterPower1) {
        this.filterPower1 = filterPower1;
    }

    public String getFluidPower() {
        return fluidPower;
    }

    public void setFluidPower(String fluidPower) {
        this.fluidPower = fluidPower;
    }

    public String getVelocityPower() {
        return velocityPower;
    }

    public void setVelocityPower(String velocityPower) {
        this.velocityPower = velocityPower;
    }

    public Integer getFilterTimer() {
        return filterTimer;
    }

    public void setFilterTimer(Integer filterTimer) {
        this.filterTimer = filterTimer;
    }

    public Integer getFilterTiming() {
        return filterTiming;
    }

    public void setFilterTiming(Integer filterTiming) {
        this.filterTiming = filterTiming;
    }

    public Integer getDiffPressSetting() {
        return diffPressSetting;
    }

    public void setDiffPressSetting(Integer diffPressSetting) {
        this.diffPressSetting = diffPressSetting;
    }

    public String getFluidStir() {
        return fluidStir;
    }

    public void setFluidStir(String fluidStir) {
        this.fluidStir = fluidStir;
    }

    public String getWaterInjection() {
        return waterInjection;
    }

    public void setWaterInjection(String waterInjection) {
        this.waterInjection = waterInjection;
    }

    public String getButterfly1() {
        return butterfly1;
    }

    public void setButterfly1(String butterfly1) {
        this.butterfly1 = butterfly1;
    }

    public String getButterfly2() {
        return butterfly2;
    }

    public void setButterfly2(String butterfly2) {
        this.butterfly2 = butterfly2;
    }

    public String getButterfly3() {
        return butterfly3;
    }

    public void setButterfly3(String butterfly3) {
        this.butterfly3 = butterfly3;
    }

    public String getDrainage() {
        return drainage;
    }

    public void setDrainage(String drainage) {
        this.drainage = drainage;
    }

    public String getFluidFormula() {
        return fluidFormula;
    }

    public void setFluidFormula(String fluidFormula) {
        this.fluidFormula = fluidFormula;
    }

    public String getDiffPress() {
        return diffPress;
    }

    public void setDiffPress(String diffPress) {
        this.diffPress = diffPress;
    }

    public Float getFluidDepth() {
        return fluidDepth;
    }

    public void setFluidDepth(Float fluidDepth) {
        this.fluidDepth = fluidDepth;
    }

    public String getWellDepth() {
        return wellDepth;
    }

    public void setWellDepth(String wellDepth) {
        this.wellDepth = wellDepth;
    }

    public String getPipPress() {
        return pipPress;
    }

    public void setPipPress(String pipPress) {
        this.pipPress = pipPress;
    }

    public String getFlow() {
        return flow;
    }

    public void setFlow(String flow) {
        this.flow = flow;
    }

    public String getFlowSum() {
        return flowSum;
    }

    public void setFlowSum(String flowSum) {
        this.flowSum = flowSum;
    }

    public String getFatFlow() {
        return fatFlow;
    }

    public void setFatFlow(String fatFlow) {
        this.fatFlow = fatFlow;
    }
}
